#ifndef __AT24CXX_H__
#define __AT24CXX_H__

#include <stdint.h>

// <<< Use Configuration Wizard in Context Menu >>>


// <o> EEPROM型号选择:  <2=>AT24C02 <8=>AT24C08 <128=>AT24C128
// <i> Default: 128 
#define EEPROM_TYPE         128

// <c1>EEPROM调试信息
//  <i>Default: 关闭EEPROM调试信息
//#define EEPROM_DEBUG
// </c>

// <c1>EEPROM Using HAL_Delay
//  <i>EEPROM Using HAL_Delay
//#define EEPROM_USING_HAL_DELAY
// </c>

// <c1>I2C Using DMA
//  <i>I2C Using DMA
//#define I2C_USING_DMA
// </c>

// <o>I2C Timeout <0x0-0xFFFFFFFF>
//	<i>Default: 0x0F
//	<i>Range: <0x0-0xFFFFFFFF>
#define I2C_TIMOUT    0x7F






#if EEPROM_TYPE == 2
  #define EEPROM_ADDR_SIZE    1
  #define EEPROM_PAGE_SIZE    8
#elif EEPROM_TYPE == 8
  #define EEPROM_ADDR_SIZE    2
  #define EEPROM_PAGE_SIZE    16
#elif EEPROM_TYPE == 128
  #define EEPROM_ADDR_SIZE    2
  #define EEPROM_PAGE_SIZE    64
#else
  #error: This model of EEPROM is not supported !
#endif
extern int E2Read(uint16_t devaddr,uint16_t Addr, uint8_t *Data, uint16_t len);
extern int E2Write(uint16_t devaddr,uint16_t Addr,uint8_t *Data,uint16_t len);

// <<< end of configuration section >>>
#endif


